home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 2 / Apprentice-Release2.iso / Source Code / C / Utilities / DVIM72-Mac 1.9.6 / source / GBLVARS.H < prev    next >
Encoding:
Text File  |  1992-09-14  |  11.1 KB  |  291 lines  |  [TEXT/R*ch]

  1. /* -*-C-*- gblvars.h */
  2. /*-->gblvars*/
  3. /**********************************************************************/
  4. /****************************** gblvars *******************************/
  5. /**********************************************************************/
  6.  
  7. /**********************************************************************/
  8. /*********************  General Global Variables  *********************/
  9. /**********************************************************************/
  10.  
  11. char curpath[MAXFNAME];            /* current file area */
  12. char curext[MAXFNAME];            /* current file extension */
  13. char curname[MAXFNAME];            /* current file name */
  14.  
  15. UNSIGN16 debug_code;            /* 0 for no debug output */
  16.  
  17. char dviname[MAXFNAME];            /* DVI filespec */
  18. char dvoname[MAXFNAME];            /* device output filespec */
  19.  
  20. char fontlist[MAXSTR];            /* FONTLIST environment string */
  21. char fontpath[MAXFNAME];        /* font directory path */
  22.  
  23. char helpcmd[MAXSTR];            /* where to look for help */
  24.  
  25. char message[MAXMSG];            /* for formatting error messages */
  26.  
  27. int basemag;                    /* takes the place of preprocessor STDMAG */
  28.  
  29. /***********************************************************************
  30. Magnification table for 144dpi, 200dpi, and 300dpi devices, computed
  31. to 20 figures and sorted by magnitude.
  32.  
  33.     Column 1         Column 2         Column 3
  34. 0.72*sqrt(1.2)**i  sqrt(1.2)**I  1.5*sqrt(1.2)**I    (I = -16,16)
  35.  
  36. ***********************************************************************/
  37. float mag_table[33];
  38.  
  39. INT16 mag_index;        /* set by actfact */
  40.  
  41. #define MAGTABSIZE (sizeof(mag_table) / sizeof(float))
  42.  
  43. BOOLEAN g_dolog = TRUE;        /* allow log file creation          */
  44. char g_progname[MAXSTR];    /* program name                  */
  45.  
  46. FILE *plotfp = (FILE*)NULL;    /* plot file pointer              */
  47.  
  48. struct char_entry
  49. {                /* character entry              */
  50.    COORDINATE wp, hp;        /* width and height in pixels          */
  51.    COORDINATE xoffp, yoffp;    /* x offset and y offset in pixels      */
  52.    long fontrp;            /* font file raster pointer          */
  53.    UNSIGN32 tfmw;        /* TFM width                  */
  54.    INT32 dx, dy;        /* character escapements          */
  55.    UNSIGN16 pxlw;        /* pixel width == round(TFM width in      */
  56.                 /* pixels for .PXL files, or          */
  57.                 /* float(char_dx)/65536.0 for .GF and .PK */
  58.                 /* files)                  */
  59.    INT16 refcount;        /* reference count for memory management  */
  60.    UNSIGN32 *rasters;        /* raster description (dynamically loaded) */
  61.  
  62. #if    (HPJETPLUS | POSTSCRIPT | IMPRESS | CANON_A2)
  63.    BOOLEAN isloaded;        /* is the character already downloaded?   */
  64. #endif /* (HPJETPLUS | POSTSCRIPT | IMPRESS | CANON_A2) */
  65.  
  66. #if    HPJETPLUS
  67.    BOOLEAN istoobig;        /* Too big (or too odd) to be loaded */
  68. #endif
  69.  
  70. #if    CANON_A2
  71.    BOOLEAN isknown;        /* Character is known */
  72.    BOOLEAN istoobig;        /* Too big to be loaded */
  73. #endif
  74.  
  75. #if    BBNBITGRAPH
  76.    BOOLEAN istoobig;        /* is the character too big for BitGraph? */
  77.    BOOLEAN isloaded;        /* is the character loaded in the BitGraph?*/
  78.    INT16 bgfont, bgchar;    /* BitGraph font and character          */
  79. #endif /* BBNBITGRAPH */
  80.  
  81. };
  82.  
  83. struct font_entry
  84. {
  85.     struct font_entry *next;    /* pointer to next font entry           */
  86.     void (*charxx)();        /* pointer to chargf(), charpk(), charpxl()*/
  87.     FILE *font_file_id;        /* file identifier (NULL if none)       */
  88.     INT32 k;            /* font number                             */
  89.     UNSIGN32 c;            /* checksum                                */
  90.     UNSIGN32 d;            /* design size                             */
  91.     UNSIGN32 s;            /* scale factor                            */
  92.     INT32 font_space;        /* computed from FNT_DEF s parameter       */
  93.     UNSIGN32 font_mag;        /* computed from FNT_DEF s and d parameters*/
  94.     UNSIGN32 magnification;    /* magnification read from PXL file       */
  95.     UNSIGN32 designsize;    /* design size read from PXL file       */
  96.     UNSIGN32 hppp;        /* horizontal pixels/point * 2**16       */
  97.     UNSIGN32 vppp;        /* vertical pixels/point * 2**16       */
  98.     INT32 min_m;        /* GF bounding box values           */
  99.     INT32 max_m;
  100.     INT32 min_n;
  101.     INT32 max_n;
  102.  
  103. #if    (CANON_A2 | HPJETPLUS | IMPRESS | POSTSCRIPT)
  104.     UNSIGN16 font_number;    /* font number (0..32767) */
  105. #endif /* (CANON_A2 | HPJETPLUS | IMPRESS | POSTSCRIPT) */
  106.  
  107. #if    CANON_A2
  108.     COORDINATE cell_w;
  109.     COORDINATE cell_h;
  110.     COORDINATE cell_d;
  111.     UNSIGN16 nloaded;
  112.     UNSIGN32 storage;
  113. #endif /* CANON_A2 */
  114.  
  115.     BYTE font_type;        /* GF, PK, or PXL font file           */
  116.     BYTE a;            /* length of font area in n[]              */
  117.     BYTE l;            /* length of font name in n[]              */
  118.     char n[MAXSTR];        /* font area and name                      */
  119.     char name[MAXSTR];        /* full name of PXL file           */
  120.     struct char_entry ch[NPXLCHARS];/* character information           */
  121. };
  122.  
  123. struct font_list
  124. {
  125.     FILE *font_id;        /* file identifier               */
  126.     INT16 use_count;        /* count of "opens"               */
  127. };
  128.  
  129. INT32 cache_size;        /* record of how much character raster        */
  130.                 /* is actually used                */
  131. float conv;            /* converts DVI units to pixels            */
  132. UNSIGN16 copies;        /* number of copies to print of each page   */
  133. INT16 cur_page_number;        /* sequential output page number in 1..N    */
  134. INT16 cur_index;        /* current index in page_ptr[]              */
  135.  
  136. COORDINATE xcp,ycp;        /* current position                */
  137. UNSIGN32 den;            /* denominator specified in preamble        */
  138. FILE *dvifp = (FILE*)NULL;    /* DVI file pointer                */
  139. struct font_entry *fontptr;    /* font_entry pointer                */
  140. struct font_entry *hfontptr = (struct font_entry *)NULL;
  141.                 /* head font_entry pointer            */
  142.  
  143. #if    (CANON_A2 | HPJETPLUS | IMPRESS | POSTSCRIPT)
  144. UNSIGN16 font_count;        /* used to assign unique font numbers        */
  145. struct font_entry *font_table[MAXFONTS];
  146. #endif /* (CANON_A2 | HPJETPLUS | IMPRESS | POSTSCRIPT) */
  147.  
  148. #if    (HPJETPLUS | POSTSCRIPT | IMPRESS | CANON_A2)
  149. BOOLEAN font_switched;        /* current font has changed            */
  150. #endif /* (HPJETPLUS | POSTSCRIPT | IMPRESS | CANON_A2) */
  151.  
  152. INT16 gf_index, pk_index, pxl_index;
  153.                 /* indexes into filelist[] in fontfile();   */
  154.                 /* they define the search order, and are    */
  155.                 /* in initglob().                */
  156. UNSIGN32 gpower[33];        /* gpower[k] = 2**k-1 (k = 0..32)        */
  157. INT32 hxxxx;            /* current horizontal position            */
  158. COORDINATE hh;            /* current horizontal position in pixels    */
  159.  
  160. #if    HPLASERJET
  161. INT16 hpres;            /* output resolution (75, 100, 150, 300 dpi) */
  162. #endif /* HPLASERJET */
  163.  
  164. UNSIGN32 img_mask[32];        /* initialized at run-time so that bit k    */
  165.                 /* (counting from high end) is one        */
  166. UNSIGN32 img_row[(MAX_M - MIN_M + 1 + 31) >> 5];
  167.                 /* current character image row of bits        */
  168. INT16 max_m, min_m, max_n, min_n;
  169.                 /* current character matrix extents        */
  170. UNSIGN16 img_words;        /* number of words in use in img_row[]        */
  171. float leftmargin;        /* left margin in inches            */
  172. COORDINATE lmargin;        /* left margin offset in pixels            */
  173. INT16 nopen;            /* number of open PXL files            */
  174. INT16 page_count;        /* number of entries in page_ptr[]        */
  175.  
  176. #if    HPJETPLUS
  177. INT16 page_fonts;        /* count of fonts used on current page      */
  178. #endif /* HPJETPLUS */
  179.  
  180. long page_ptr[MAXPAGE+1];    /* byte pointers to pages (reverse order)   */
  181.  
  182. #if    POSTSCRIPT
  183. long page_loc[MAXPAGE+1];    /* byte pointers to output pages        */
  184. INT32 page_tex[MAXPAGE+1];    /* TeX's \count0 page numbers            */
  185. #endif /* POSTSCRIPT */
  186.  
  187. INT16 page_begin[MAXREQUEST+1],
  188.     page_end[MAXREQUEST+1],
  189.     page_step[MAXREQUEST+1];    /* explicit page range requests            */
  190. INT16 npage;            /* number of explicit page range requests   */
  191. struct font_list font_files[MAXOPEN+1];
  192.                 /* list of open PXL file identifiers        */
  193.  
  194. UNSIGN32 power[32];        /* power[k] = 1 << k                */
  195.  
  196. #if    POSTSCRIPT
  197. BOOLEAN ps_vmbug;        /* reload fonts on each page when TRUE        */
  198. #endif /* POSTSCRIPT */
  199.  
  200. UNSIGN32 rightones[HOST_WORD_SIZE];/* bit masks */
  201.  
  202. #if    (APPLEIMAGEWRITER | EPSON | DECLA75 | DECLN03PLUS)
  203. BOOLEAN runlengthcode = FALSE;        /* this is runtime option '-r' */
  204. #endif /* (APPLEIMAGEWRITER | EPSON | DECLA75 | DECLN03PLUS) */
  205.  
  206. #if    (GOLDENDAWNGL100 | TOSHIBAP1351)
  207. BOOLEAN runlengthcode = FALSE;        /* this is runtime option '-r' */
  208. #endif /* (GOLDENDAWNGL100 | TOSHIBAP1351) */
  209.  
  210. UNSIGN32 runmag;        /* runtime magnification            */
  211. UNSIGN32 mag;            /* magnification specified in preamble        */
  212. UNSIGN32 num;            /* numerator specified in preamble        */
  213. struct font_entry *pfontptr = (struct font_entry *)NULL;
  214.                 /* previous font_entry pointer            */
  215. BOOLEAN preload = TRUE;        /* preload the font descriptions?        */
  216. FILE *fontfp = (FILE*)NULL;    /* font file pointer                */
  217.  
  218. BOOLEAN quiet = FALSE;        /* suppress status display when TRUE        */
  219.  
  220. BOOLEAN backwards = FALSE;    /* print in backwards order            */
  221.  
  222. #if    (CANON_A2 | HPJETPLUS | IMPRESS | POSTSCRIPT)
  223. COORDINATE rule_height;        /* parameters of last rule set */
  224. COORDINATE rule_width;
  225. COORDINATE str_ycp;        /* last string ycp value */
  226. UNSIGN16 size_limit;        /* character size limit in pixels -- larger */
  227.                 /* characters are downloaded each time they */
  228.                 /* are required to avoid PostScript ROM bugs */
  229. #endif /* (CANON_A2 | HPJETPLUS | IMPRESS | POSTSCRIPT) */
  230.  
  231. #if    (BSD42 | OS_TOPS20)
  232. BOOLEAN spool_output = FALSE;    /* offer to send output to spooler */
  233. #endif /* (BSD42 | OS_TOPS20) */
  234.  
  235. char subpath[MAXFNAME];        /* font substitution file path            */
  236. char subname[MAXFNAME];        /* font substitution file name field        */
  237. char subext[MAXFNAME];        /* font substitution file extension field   */
  238. char subfile[MAXFNAME];        /* font substitution filename            */
  239.  
  240. INT32 tex_counter[10];        /* TeX c0..c9 counters on current page      */
  241. float topmargin;        /* top margin in inches                */
  242. COORDINATE tmargin;        /* top margin offset in pixels            */
  243.  
  244. INT32 vxxxx;            /* current vertical position            */
  245.  
  246. #if    VIRTUAL_FONTS
  247. BOOLEAN virt_font;        /* virtual font cache flag                  */
  248. struct virt_data
  249.     {
  250.     int    cnt;
  251.     char    *ptr;
  252.     char    *base;
  253.     };
  254. struct virt_data virt_save[_NFILE];/* space for saving old FILE values      */
  255. #endif /* VIRTUAL_FONTS */
  256.  
  257. COORDINATE vv;            /* current vertical position in pixels        */
  258.  
  259. #if    BBNBITGRAPH
  260. struct char_entry *bgcp[NBGFONTS+(NBGFONTS+2)/3][NPXLCHARS];
  261.     /* Pointer to corresponding char_entry for this BitGraph font */
  262.     /* and character.  These are used to set the char_entry's */
  263.     /* status to "not loaded" when we have to reuse the BitGraph */
  264.     /* character.  The array is cleared initially in devinit(). */
  265.  
  266. INT16 fullfont = 0;        /* full font to load in BitGraph        */
  267. BOOLEAN g_interactive=TRUE;    /* is the program running interactively   */
  268.                 /* (i.e., standard output not redirected)? */
  269. INT16 partchar = FIRSTBGCHAR;    /* partial font character to load in BitGraph*/
  270. INT16 partfont = NBGFONTS;    /* partial font to load in BitGraph        */
  271. INT16 pbghpos;            /* previous BitGraph horizontal position    */
  272. INT16 pbgvpos;            /* previous BitGraph vertical position        */
  273. INT16 pbgf = -1;        /* previous BitGraph font            */
  274. COORDINATE xdiff;        /* x difference                    */
  275. COORDINATE xscreen;        /* x screen adjustment                */
  276. COORDINATE ydiff;        /* y difference                    */
  277. COORDINATE yscreen;        /* y screen adjustment                */
  278. long cpagep;            /* pointer to current page in DVI file        */
  279. long ppagep;            /* pointer to previous page in DVI file     */
  280.  
  281. #if    OS_TOPS20
  282. #define jfn_plotfp (jfnof(fileno(plotfp)))
  283.  
  284. int bg_length,bg_width,bg_1ccoc,bg_2ccoc,bg_modeword,bg_sysmsg;
  285. #endif /* OS_TOPS20 */
  286.  
  287. #endif /* BBNBITGRAPH */
  288.  
  289. #if OS_THINKC
  290. TPPrPort    g_print_port_p;
  291. #endif